import http from '@/utils/http';

export default {
    getAll:(): Promise<Array<Vm.Class>> => http<null,Array<Vm.Class>>({url:"/class/all"}),
    getList:(data: HttpPayload.GetClass): Promise<Vm.ClassData> => http<HttpPayload.GetClass,Vm.ClassData>({url:"/class/list",method:"post",data}),
    add:(data:Vm.Class): Promise<number> => http<Vm.Class,number>({url:"/class/add",method:"post",data}),
    update:(data:Vm.Class): Promise<null> => http<Vm.Class,null>({url:"/class/update",method:"post",data}),
    // 开课*结课
    end: (data: {cls_id: number}): Promise<number> => http<{cls_id: number}, number>({ url: '/class/end', method: "post", data}),
    start: (data: HttpPayload.ClassStart): Promise<number> => http< HttpPayload.ClassStart, number>({ url: '/class/begin', method: "post", data })
}